package com.hc.app.frequency;

import com.hc.app.annatation.FrequencyControl;
import com.hc.app.constant.FrequencyControlConstant;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("frequency")
public class FrequencyController {

    @FrequencyControl(time = 5,count = 4,spEl = "#name", strategy = FrequencyControlConstant.TOKEN_BUCKET,target = FrequencyControl.Target.EL)
    @RequestMapping("/test")
    public String TestFrequency(@RequestParam("name") String name){
        return "frequency"+name;
    }

}
